/*
 * stock.cpp
 *
 *  Created on: Aug 16, 2012
 *      Author: jh238d
 */
#include <iostream>
#include <climits>
using namespace std;

void sell_stock(int arr[], int n, int &buy, int &sell){
	int max = 0, min = 0;
	buy = sell = 0;
	for(int i=0; i<n-1; i++){
		if(arr[i]<arr[min])
			min = i;
		int tmp = arr[i]-arr[min];
		if(tmp>max){
			max=tmp;
			sell=i;
			buy=min;
		}
	}
}



